fix(security): Migration auf @huggingface/transformers v4 + ner-worker-Build-Fix#3
Closed
Baldri wants to merge 3 commits into
Closed
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Plan was fully implemented on 2026-03-17 (GitHub release v0.7.0, mingly-website commit 02e6d22, preprocessor fixes shipped) but the checkboxes were never ticked. Verified against live site, app and release on 2026-07-02; marked done and committed as historical record. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replaces @xenova/transformers 2.17.2 with @huggingface/transformers 4.2.0 (the maintained successor). Eliminates the entire protobufjs critical advisory chain (11 advisories incl. GHSA-xq3m-2v4x-88gg arbitrary code execution) via @xenova -> onnxruntime-web -> onnx-proto -> protobufjs: npm audit --omit=dev is now clean (0 vulnerabilities). API changes: package rename in 4 dynamic imports; quantized:false -> dtype:'fp32' (option removed in v3+). env.cacheDir/allowRemoteModels, progress_callback, cache layout and token-classification output are unchanged - the existing piiranha-v1 model cache is reused without re-download. Also fixes a latent build gap: dist/main/ner-worker.js was never built (no esbuild entry), so NERDetector silently fell back to [] in packaged builds - the 3-layer NER path was dead in production. New build:ner-worker script is chained into build. Verified: typecheck + full test suite green, build produces the worker bundle, RUN_3LAYER=1 red-team run loads piiranha via the new library from the existing cache (776ms) with 42 failures vs 48 in the 2026-03-17 baseline - all 7 documented NER-fixed tests still pass, no regressions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Was
Migration von @xenova/transformers 2.17.2 auf @huggingface/transformers 4.2.0 (gepflegter Nachfolger) plus Fix des nie gebauten NER-Workers.
Warum
dist/main/ner-worker.jswurde von keinem Build-Script erzeugt → NERDetector fiel im gebauten Produkt still auf[]zurück, der 3-Layer-NER-Pfad war im Release-Build tot.Änderungen
build:main-External angepasst; neues Scriptbuild:ner-workerin die Build-Chain eingehängtquantized: false→dtype: 'fp32'(ner-worker.ts, model-manager.ts, direct-ner-detector.ts, privacy-ner-integration.test.ts)Tests
npm run typecheck: grün |CI=1 npm test: Exit 0 |npm run build: grün,dist/main/ner-worker.js(6.3 kB) wird erzeugtnpm audit --omit=dev: 0 Vulnerabilities (vorher 4 nach PR fix: Prüf-Session — Commit-Gate entblockt, Deps gepatcht, Modellkatalog aktualisiert #2, 9 vor der Prüf-Session)RUN_3LAYER=1 npm run test:red-teamlädt piiranha über die neue Library aus dem bestehenden Cache (776 ms), 42 Failures vs. 48 in der Baseline 2026-03-17 — alle 7 dokumentierten 'Fixed by NER'-Tests bestehen weiterhinReview-Punkte
dist:macprüfen (Prüfpunkt, kein Blocker)dtype: 'fp32'entspricht dem bisherigenquantized: false(Node-Default wäre ohnehin fp32)Dokumentation
🤖 Generated with Claude Code